/**
 * Copyright (c) 2006-2007 Jinyi.lu
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of GNU LGPL license by gun.org
 * which accompanies this distribution, and is available at
 * http://gnu.feld-it.at/copyleft/lesser.html
 * 
 * Project Homepage : http://code.google.com/p/demou
 * Source Code: svn checkout http://demou.googlecode.com/svn/trunk/ demou
 * Mailing list : jinyi.lu@gmail.com
 *                stonelu@126.com
 *
 *  
 * Contributors:
 *     JinYi.Lu - initial API and implementation
 */
package cn.tworen.demou.handler;

import org.apache.log4j.Logger;

import cn.tworen.demou.cmd.IBufferCmd;
import cn.tworen.demou.cmd.ICmd;
import cn.tworen.demou.rtmp.Client;

/**
 * Created on  2007-2-1
 *
 * Title       : ChunkSizeHandler.java
 * Description : 
 * 
 * @author     : LuJinYi
 * @version    : 1.0
 * @Date       : 2007-2-1
 * History     : 
 * 
 */
public class ChunkSizeHandler  implements IListener{
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger
			.getLogger(ChunkSizeHandler.class);

	public void recevie(Client client,ICmd cmd) {
		logger.debug("ChunkSizeHandler");
		IBufferCmd bufferCmd = (IBufferCmd)cmd;
		logger.debug(bufferCmd.getBody().dump());
		client.setChunkSize(bufferCmd.getBody().getInt());
		logger.debug("Change Chunk Size=" + client.getChunkSize());
	}

}
